<?php
/**
 * @version      BOSSCMS-Free
 * @trademark    BOSSCMS
 * @copyright    Copyright © by BOSSCMS-Free (https://www.bosscms.net/) 保留所有权利
 * @license      https://gitee.com/Greenpeas/BOSSCMS/license/ 和 https://www.bosscms.net/freelicense/
 * @link         https://www.bosscms.net/
 * @author       温州软界网络技术有限公司
**/
defined('IS_OK') or exit('Access Forbidden');
$audit = BOSSCMS_MOLD=='audit'?1:null;
?>
<?php load::into('head'); ?>
<?php echo $G['navsub']; ?>
<section class="main table">
  <aside>
    <div>  
      <div class="head">
        <a class="button tfa green openContent">
          <font class="fa fa-outdent"></font>
        </a>
        <a class="button green" easy url="<?php echo url::mpf('group','group','edit',array('type'=>null)); ?>">
          <em class="fa fa-plus"></em>
          <font>发布内容</font>
        </a>
        <span>
          <b>搜索：</b>
          <?php echo form::input('keyword',stripslashes($data['keyword']),null,'text',array('placeholder'=>'输入内容标题、id')); ?>
        </span>
        <span>
          <b>栏目：</b>
          <?php echo form::select('items',$G['get']['items'],null,$G['subarr'],array('placeholder'=>'选择栏目')); ?>
        </span>
        <span>
          <button class="button green">
            <em class="fa fa-search"></em>
            <font>搜索</font>
          </button>
        </span>
      </div>
      <form id="group" action="<?php echo url::mpf('group','group','modify'); ?>" method="post" enctype="multipart/form-data">
        <table class="mobile">
          <tbody>
            <tr>
              <th>选择</th>
              <th>排序</th>
              <th>标题</th>
              <th>点击</th>
              <th>更新时间</th>
              <th>栏目</th>
              <th>发布人</th>
              <th>操作</th>
            </tr>
            <?php
            foreach($data['list'] as $v){
            ?>
            <tr>
              <td width="48"><?php echo form::checkbox('id',null,null,array($v['type'].'_'.$v['id']=>null)); ?></td>
              <td t="排序" width="58"><?php echo form::input("sort{$v['type']}_{$v['id']}",$v['sort'],null,'text',null); ?></td>
              <td t="标题">
                <?php echo $v['name']; ?>
                <small>[id: <?php echo $v['id']; ?>]</small>
                <?php if($v['image']){ ?><a class="fa fa-picture-o" href="<?php echo url::upload($v['image']); ?>" title="查看图片" target="_blank"></a><?php } ?>
                <?php if($v['top']){ ?>
                <span class="btn">
                  <a href="<?php echo url::mpf('group','group','attr',array('top'=>1,'id'=>$v['id'],'type'=>$v['type'])); ?>" title="取消置顶">置顶</a>
                </span>
                <?php } ?>
                <?php if($v['recommend']){ ?>
                <span class="btn">
                  <?php
                  $recommend = $v['recommend']=='1'?array('c'):explode(',',$v['recommend']);
                  foreach($recommend as $v2){
                  ?>
                  <a href="<?php echo url::mpf('group','group','attr',array('flag'=>$v2,'id'=>$v['id'],'type'=>$v['type'])); ?>" title="取消<?php echo $G['attrflag'][$v2]; ?>"><?php echo $G['attrflag'][$v2]; ?></a>
                  <?php } ?>
                </span>
                <?php } ?>
              </td>
              <td t="点击" w5 mh width="68" grey><?php echo $v['notice']; ?></td>
              <td t="时间" w5 width="108" grey><?php echo date('Y-m-d',$v['mtime']); ?></td>
              <td t="栏目" mh width="128" grey>
                <a href="<?php echo url::mpf('group','group','init',array('items'=>$v['items'])); ?>"><?php echo preg_replace('/<font>.+<\/font>/','',$G['subarr'][$v['items']]); ?></a>
              </td>
              <td t="发布人" mh w5 s3 width="108" grey><?php echo $v['user']; ?></td>
              <td t="操作" width="198">
                <a class="btnfa black" href="<?php echo $v['url']; ?>" target="_blank">
                  <em class="fa fa-eye" title="浏览"></em>
                </a>
                <a class="btnfa black" easy name="修改内容" url="<?php echo url::mpf('group','group','edit',array('id'=>$v['id'],'type'=>$v['type'],'items'=>$v['items'])); ?>">
                  <em class="fa fa-pencil" title="修改"></em>
                </a>
                <a class="btnfa red delete" url="<?php echo url::mpf('group','group','delete',array('id'=>$v['type'].'_'.$v['id'])); ?>">
                  <em class="fa fa-trash-o" title="删除"></em>
                </a>
              </td>
            </tr>
            <?php
            }
            ?>
          </tbody>
        </table>
      </form>
    </div>
  </aside>
</section>
<section class="refer" <?php echo $G['body_class']=='iframe-content'?(is_numeric($_COOKIE['iframeContentX'])?'style="margin-left:'.$_COOKIE['iframeContentX'].'px;"':'contentx'):''; ?>>
  <?php echo html::admpages($data['pages'],$data['total']); ?>
  <p>
    <a class="button green  checkall">
      <em class="fa fa-square"></em>
      <font>全选</font>
    </a>
    <a class="button green tfa nocheckall">
      <em class="fa fa-square-o"></em>
      <font>取消</font>
    </a>
    <button form="group" class="button green ">
      <em class="fa fa-sort"></em>
      <font>排序</font>
    </button>
    <a class="button green clickcheck" width="680" height="280" name="复制到栏目" easy="nofull" url="<?php echo url::mpf('group','group','paste',array('action'=>'copys')); ?>">
      <em class="fa fa-copy"></em>
      <font>复制</font>
    </a>
    <a class="button green clickcheck" width="680" height="280" name="移动到栏目" easy="nofull" url="<?php echo url::mpf('group','group','paste',array('action'=>'move')); ?>">
      <em class="fa fa-clipboard"></em>
      <font>移动</font>
    </a>
    <a class="button red tfa delcheck" url="<?php echo url::mpf('group','group','delete'); ?>">
      <em class="fa fa-trash-o"></em>
      <font>删除</font>
    </a>
  </p>
</section>
<script>window.models = <?php echo json::encode($G['models']); ?>;window.type = '<?php echo $G['get']['type']; ?>';</script>
<?php load::into('foot'); ?>